<template>
	<view>
		<view class="" v-if="!billList.length">
			<u-empty text="暂无消费记录" textSize="30rpx" marginTop="335rpx" width="330rpx" height="256rpx" icon="order">
			</u-empty>
		</view>
		<view v-if="billList.length">
			<view class="box-top-x"></view>
			<view class="bill" v-for="(billListItem, billListIndex) in billList" :key="billListIndex"
				v-if="billListItem.type!=17">
				<view class=" bill-left">
					<view class="bill-title">{{ billListItem.description }}</view>
					<view class="bill-runningWater">{{ '流水号：' + billListItem.tradeno }}</view>
					<view class="bill-time">{{ billListItem.time }}</view>
				</view>
				<view class="bill-rigth">
					<view class="bill-rigth-top" v-if="billListItem.type == '0'">
						{{ billListItem.fee + '次' }}
					</view>
					<view class="bill-rigth-top" v-if="billListItem.type == '11'">
						{{ billListItem.fee + '次' }}
					</view>
					<view class="bill-rigth-top" v-if="billListItem.type != '0' && billListItem.type != '11'">
						{{ billListItem.fee + (billListItem.type == '19' ? '天' : '元') }}
					</view>
					
					<view class="bill-type">
						<view>{{ billListItem.description }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		apiMixUrlApi
	} from '@/api/assemb.js';
	export default {
		data() {
			return {
				billList: [{
					description: "培音客服增加会员",
					fee: "10",
					time: "2022-10-25 18:12:30",
					tradeno: "20221025181230kz3v",
					type: "19",
					userid: "148334"
				}]
			};
		},
		onLoad() {
			this.fetchBills();
		},
		methods: {
			fetchBills() {
				var self = this;
				let param = {};
				apiMixUrlApi(param, 1030, 'GetBills').then(result => {
					this.billList = result.history;
				});
			}
		}
	};
</script>

<style lang="scss" scoped>
	.bill {
		width: 748rpx;
		height: 190rpx;
		background: #ffffff;
		border-bottom: 1rpx solid #e0e0e0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.bill image {
		width: 24rpx;
		height: 24rpx;
	}

	.bill-title {
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #3e3e3e;
		margin-bottom: 17rpx;
	}

	.bill-runningWater,
	.bill-time {
		font-size: 25rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #b2b2b2;
		line-height: 35rpx;
	}

	.bill-rigth-bo {
		display: flex;
	}

	.bill-type {
		display: flex;
		justify-content: left;
		align-items: center;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #b2b2b2;
	}

	.bill-type image {
		margin-right: 12rpx;
	}

	.bill-left {
		margin-left: 38rpx;
	}

	.bill-rigth {
		margin-right: 25rpx;
	}

	.bill-rigth-top {
		margin-left: 24rpx;
		margin-bottom: 24rpx;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #3e3e3e;
	}

	.noData {
		margin-top: 469rpx;
		text-align: center;
	}

	.noData-img {
		width: 237rpx;
		height: 139rpx;
	}

	.noData-text {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #b3b3b3;
		margin-top: 42rpx;
	}
</style>